From 2af7264cffa2fad65936c76c184b1c6ec5efc284 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 29 Jul 2020 14:22:58 +0200 Subject: [PATCH] LoginManager: Add canRebootToBootLoaderMenu and setRebootToBootLoaderMenu methods Add wrappers for the new logind Manager CanRebootToBootLoaderMenu and SetRebootToBootLoaderMenu dbus methods. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/199 --- .../org.freedesktop.login1.Manager.xml | 6 +++++ js/misc/loginManager.js | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/data/dbus-interfaces/org.freedesktop.login1.Manager.xml b/data/dbus-interfaces/org.freedesktop.login1.Manager.xml index 647afc6cf..f40d498dc 100644 --- a/data/dbus-interfaces/org.freedesktop.login1.Manager.xml +++ b/data/dbus-interfaces/org.freedesktop.login1.Manager.xml @@ -20,6 +20,12 @@ + + + + + + diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js index 0f9ee1703..55e928986 100644 --- a/js/misc/loginManager.js +++ b/js/misc/loginManager.js @@ -158,6 +158,23 @@ var LoginManagerSystemd = class { }); } + canRebootToBootLoaderMenu(asyncCallback) { + this._proxy.CanRebootToBootLoaderMenuRemote((result, error) => { + if (error) { + asyncCallback(false, false); + } else { + const needsAuth = result[0] === 'challenge'; + const canRebootToBootLoaderMenu = needsAuth || result[0] === 'yes'; + asyncCallback(canRebootToBootLoaderMenu, needsAuth); + } + }); + } + + setRebootToBootLoaderMenu() { + /* Parameter is timeout in usec, show to menu for 60 seconds */ + this._proxy.SetRebootToBootLoaderMenuRemote(60000000); + } + listSessions(asyncCallback) { this._proxy.ListSessionsRemote((result, error) => { if (error) @@ -203,6 +220,13 @@ var LoginManagerDummy = class { asyncCallback(false, false); } + canRebootToBootLoaderMenu(asyncCallback) { + asyncCallback(false, false); + } + + setRebootToBootLoaderMenu() { + } + listSessions(asyncCallback) { asyncCallback([]); } -- 2.39.5